#i2c_lcd1602.py
#监测显示屏功能是否正常
import LCD1602
import time

def setup(s1,s2):
    LCD1602.init(0x27, 1)
    LCD1602.write(0, 0, s1)
    LCD1602.write(1, 1, s2)
    #time.sleep(2)

def loop():
    space = '................'
    greetings = 'Thank you for buying ZHIYU Sensor Kit for Raspberry! ^_^'
    greetings = space + greetings
    while True:
        tmp = greetings
        for i in range(0, len(greetings)):
            LCD1602.write(0, 0, tmp)
            tmp = tmp[1:]
            time.sleep(0.8)
            LCD1602.clear()

def destroy():
    pass
"""
if __name__ == "__main__":
    try:
        s1='Greeting!!'
        s2='WWW.HNZHIYU.CN'
        setup(s1,s2)
        while True:
            pass
    except KeyboardInterrupt:
        destroy()
"""     